Skip to content

feat(pgpm): add --include flag for additional Docker services (minio)#975

Merged
pyramation merged 2 commits intomainfrom
feat/pgpm-docker-include-services
Apr 11, 2026
Merged

feat(pgpm): add --include flag for additional Docker services (minio)#975
pyramation merged 2 commits intomainfrom
feat/pgpm-docker-include-services

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Apr 11, 2026

Summary

Extends pgpm docker to support additional Docker services alongside PostgreSQL via a new --include <service> flag. PostgreSQL remains the primary service started by default; additional services are opt-in only.

New capabilities:

  • pgpm docker start --include minio — starts MinIO alongside Postgres
  • pgpm docker stop --include minio — stops both
  • pgpm docker ls — lists available services with live status (running/stopped/not created)

Architecture: A ServiceDefinition interface and ADDITIONAL_SERVICES registry make it straightforward to add more services in the future — just add an entry to the registry. Each service definition supports image, ports, env vars, commands, and named volumes.

MinIO is the first additional service (minio/minio, port 9000, default creds minioadmin/minioadmin), with a named Docker volume (minio-data) for persistent /data storage across container restarts and --recreate cycles.

All existing commands (pgpm docker start, pgpm docker stop) behave identically when --include is not specified.

Review & Testing Checklist for Human

  • MinIO env var naming: The registry uses MINIO_ACCESS_KEY/MINIO_SECRET_KEY (legacy names), but the CI workflow uses MINIO_ROOT_USER/MINIO_ROOT_PASSWORD. Depending on the minio/minio image tag, the older names may be deprecated — verify these still work with minio/minio:latest
  • Verify --include flag parsing with inquirerer: parseInclude handles both string and string[], but confirm that repeated flags (--include minio --include redis) actually produce an array from the arg parser rather than only keeping the last value
  • End-to-end test: Run pgpm docker start --include minio locally, confirm both containers come up, then pgpm docker ls to check status output, and pgpm docker stop --include minio to tear down
  • Volume persistence: After pgpm docker start --include minio, upload a file to MinIO, then pgpm docker stop --include minio && pgpm docker start --include minio and verify the file is still there

Notes

  • pgpm env is intentionally not changed — no MinIO/CDN env vars are exported. Users who include MinIO will need to set CDN_ENDPOINT, AWS_ACCESS_KEY, etc. separately.
  • startService duplicates the recreate/exists/running logic from startContainer. A future refactor could unify them, but keeping them separate avoids touching the existing Postgres-specific code path.
  • listServices hardcodes the postgres container name as "postgres" — it won't detect a Postgres container started with a custom --name.
  • No automated tests were added — this is a CLI/Docker orchestration command that would require Docker-in-Docker to test in CI.

Link to Devin session: https://app.devin.ai/sessions/44eca4b3fe5a46aaaf5c4907f0a0b600
Requested by: @pyramation

- Add ServiceDefinition registry for additional services
- Add --include <svc> flag to start/stop additional services alongside Postgres
- Add 'ls' subcommand to list available services and their status
- Add minio as first additional service (port 9000)
- Postgres remains the primary service, started by default
- All existing commands remain backward compatible
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

- Add VolumeMapping interface and volumes field to ServiceDefinition
- Minio now uses a named 'minio-data' volume for persistent /data storage
- Data persists across stop/start and --recreate cycles
@pyramation pyramation merged commit e4dc3b0 into main Apr 11, 2026
49 checks passed
@pyramation pyramation deleted the feat/pgpm-docker-include-services branch April 11, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant